Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Stop pyvcloud creating an empty log file called 'vcd_sdk.log' #766

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrew-lee-1089
Copy link

@andrew-lee-1089 andrew-lee-1089 commented Jun 8, 2021

Remove the need to call "Get_logger" which inadvertently creates an empty vcd_sdk.log file in your current working directory, which seems un-useful for a single log across the whole project.

pyvcloud is great -but there is no logging, I think that is basically fine so long as we are consistent with that fact, implementing logging for one log feels like the worst of both worlds, and is leaving us with an empty file in our current working directory, with no way to configure this log file name or location. I rejected the idea of doing anything fancier here, because sorting out logging in this project felt too big a task for a Tuesday morning.

I've not tested.

Can someone please review?


This change is Reviewable

Remove the need to call "Get_logger" which inadvertently creates an empty `vcd_sdk.log` file in your home directory, which seems unuseful for a single log across the whole project.
Copy link
Contributor

@rocknes rocknes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @andrew-lee-metaswitch)


pyvcloud/vcd/vapp.py, line 1605 at r1 (raw file):

                no_of_vm_upgraded += 1
            except OperationNotSupportedException:
                raise OperationNotSupportedException(

Under normal circumstance raising an exception here would make perfect sense. However, by changing the current behavior (no exception -> raising exception) we risk breaking existing users of this method.

We will merge this in the next major release of pyvcloud.

@andrew-lee-1089
Copy link
Author

If I changed it from logger.error to just print - would that be acceptable / not-deemed a non-breaking change?

@andrew-lee-1089
Copy link
Author

@rocknes any update on this? I'd like to get this released if possible.

Thanks!

@volehuy1998
Copy link

@rocknes , same here. Could we sync path log from client initialzation to this or optional it by path?
def _get_default_logger(self, file_name="vcd_pysdk.log",

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants